<?php

class CreateService extends Service{
     public static function getJobType() {
		$sql = Yii::app()->db->createCommand('select * from tbl_jobtype');
		$type = CHtml::listData($sql->queryAll(), 'id', 'name');
		return $type;

	}
    protected function beforeValidate(){
		if ($this->isNewRecord) {
			$this->status = 1;
			$this->viewed = 0;
		}
		return parent::beforeValidate();
	}
    
}

?>